<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="content-type" content="text/html" charset="utf-8" />
    <title>Welcome to dashboard</title>
    <link type="text/css" rel="stylesheet" href="<?=base_url('css/backend/manager.css')?>"/>
    <script type="text/javascript">
        //default image
        function defaultimg(img)
        {
            img.src='<?=base_url('images/noimage.jpg')?>';
        }
    </script>
    <!--set base for ckfinder-->
    <base href="<?=base_url()?>"/>
</head>
<body> 
    <?php 
        $CI=& get_instance();
        $CI->load->library('session');
    ?>
    <div id="wrapper">
        <div id="header">
            banner
        </div>
        <div class="logout">
            Welcome <span><?=$CI->session->userdata('username')?></span>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <a target="_blank" href="<?=base_url()?>">View Site</a>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <a href="<?=base_url('dashboard/login/log_out')?>">Log out</a>
        </div>
        <div id="content">
            <div class="section-left">
                <div class="box-ct">
                    <div>
                        <div class="home-page">
                            <a href="<?=site_url('dashboard/backend')?>">Administration</a>
                        </div>
                        <ul class="list-tbl">
                            <?php
                                foreach($list_table as $k=>$v): 
                            ?>
                            <li>
                                <?=$v?>
                                <ul>
                                    <li>
                                        <a href="<?=site_url("dashboard/backend/insert/{$k}")?>">Add</a>
                                    </li>
                                    <li>
                                        <a href="<?=site_url("dashboard/backend/view/{$k}")?>">List</a>
                                    </li>
                                </ul>
                            </li>
                            <?php
                                endforeach;
                            ?>
                        </ul>
                    </div>
                </div>
            </div>
            <div class="section-right">
                <div class="box-ct">
                    <?php
                        if(isset($action))
                        {
                            switch($action)
                            {
                                case 'insert':  $CI->load->view('dashboard/site_insert',$content);break;            
                                case 'view':    $CI->load->view('dashboard/site_view',$content);break; 
                                default:        $CI->load->view('dashboard/site_welcome');break;       
                            }
                        }
                        else
                        {
                            $CI->load->view('dashboard/site_welcome');
                        } 
                    ?>
                </div>
            </div>
            <div class="clr"></div>
        </div>
        <div id="footer">
            footer
        </div>
    </div>
</body>
</html>